package com.liao.order.controller;

import com.liao.common.entity.order.OrderReturnApplyEntity;
import com.liao.common.utils.PageUtils;
import com.liao.order.service.OrderReturnApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 订单退货申请
 *
 * @author liao
 * @email 2858015963@qq.com
 * @date 2025-03-14 09:23:11
 */
@RestController
@RequestMapping("order/orderreturnapply")
public class OrderReturnApplyController {
    @Autowired
    private OrderReturnApplyService orderReturnApplyService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public PageUtils<OrderReturnApplyEntity> list(@RequestParam Map<String, Object> params) {
        return orderReturnApplyService.queryPage(params);


    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public OrderReturnApplyEntity info(@PathVariable("id") Long id) {
        return orderReturnApplyService.getById(id);

    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public void save(@RequestBody OrderReturnApplyEntity orderReturnApply) {
        orderReturnApplyService.save(orderReturnApply);
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public void update(@RequestBody OrderReturnApplyEntity orderReturnApply) {
        orderReturnApplyService.updateById(orderReturnApply);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public void delete(@RequestBody Long[] ids) {
        orderReturnApplyService.removeByIds(Arrays.asList(ids));
    }

}
